package com.moli.iov.notify.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moli.iov.notify.mapper.MailMapper;
import com.moli.iov.notify.model.dto.MailDto;
import com.moli.iov.notify.model.po.Mail;
import com.moli.iov.notify.service.IMailService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *
 * </p>
 *
 * @author zql
 * @since 2019/9/10 19:23
 */
@Service
public class MailServiceImpl extends ServiceImpl<MailMapper, Mail> implements
    IMailService {

  /**
   * 保存邮件
   * @param mailDto
   * @return
   */
  @Override
  public boolean saveNotifyMail(MailDto mailDto) {
    Mail notifyMail = new Mail();

    notifyMail.setMailFrom(mailDto.getFrom());
    notifyMail.setMailTo(mailDto.getTo());
    notifyMail.setContent(mailDto.getText());
    notifyMail.setMailSubject(mailDto.getSubject());
    notifyMail.setStatus(mailDto.getStatus());
    return super.save(notifyMail);
  }
}
